<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"><title>工作日</title>
<head th:replace="common/incHead :: incHead"></head>
<body class="gray-bg">
<div class="ok-body">
    <form class="layui-form layui-form-pane" lay-filter="pagerForm" id="pagerForm" action="/base/const/workdate" method="get">
        <input type="hidden" id="pageNum" name="pageNum" value="1"/>
        <input type="hidden" name="numPerPage" th:value="${page?.numPerPage}"/>
        <input type="hidden" name="orderField" th:value="${orderField}"/>
        <input type="hidden" name="orderDirection" th:value="${orderDirection}"/>
        <div class="layui-row pa-condition">
            <div class="layui-row">
                <div th:replace="common/plugin :: pa-input-cond('ts','开始时间','layui-col-md2',${ts})"></div>
                <div th:replace="common/plugin :: pa-input-cond('te','结束时间','layui-col-md2',${te})"></div>
                <div th:replace="common/plugin :: pa-input-cond('dateDay','工作日','layui-col-md2',${dateDay})"></div>
                <button class="layui-btn layui-btn-sm layui-btn-primary pull-right m-l-xs" title="重置数据" type="reset"><i class="layui-icon layui-icon-return"></i>重置</button>
                <button class="layui-btn layui-btn-sm layui-btn-normal pull-right btnPagerForm" title="重新检索"><i class="layui-icon layui-icon-search"></i>重新检索</button>
            </div>
        </div>
    </form>
    <div class="layui-row ljLayTableBox m-b-xl">
        <table class="layui-hide" id="indexTable" lay-filter="indexTable"></table>
    </div>
</div>
<div th:replace="common/incBottom :: incBottom"></div>
<div th:replace="common/incPage :: incPage"></div>
<!-- 初始化表格数据 -->
<script th:inline="javascript">
    /*<![CDATA[*/
    let indexData = [];
    /*[# th:each="item,itemStat:${records}"]*/
    indexData.push({
        id: [[${item.id}]],
        dateDay: [[${item.dateDay}]],
        t1Status: [[${item.t1Status}]],
        t1StatusShow: [[${@lj.code("YesNo",item.t1Status)}]],
        t0Status: [[${item.t0Status}]],
        t0StatusShow: [[${@lj.code("YesNo",item.t0Status)}]],
        dataStatus: [[${item.dataStatus}]],
        createTime: [[${@lj.date(item.createTime)}]]
    });
    /*[/]*/
    /*]]>*/
</script>
<script th:inline="none">
    layui.use(["jquery", "table", "okLayer", "okPapper", "okUtils"], function () {
        let table = layui.table;
        let okPapper = layui.okPapper;
        let $ = layui.jquery;
        let okUtils = layui.okUtils;
        let config = okUtils.local("okConfig") || okConfig || {};
        table.render({
            elem: '#indexTable',
            id: 'indexTable',
            height: 'full-118',
            page: false,
            data: indexData,
            limit: indexData.length,
            toolbar: true,
            toolbar: "#toolbarTpl",
            size: config.tableSize,
            cols: [[
                {field: "id", title: "自增ID", fixed: "left", width: 100},
                {field: "dateDay", title: "工作日", width: 150},
                {field: "t1Status", title: "快捷工作日", width: 150, templet: "<div><selction class='YesNo-{{d.t1Status}}'>{{d.t1StatusShow}}</selction></div>"},
                {field: "t0Status", title: "普通工作日", width: 150, templet: "<div><selction class='YesNo-{{d.t0Status}}'>{{d.t0StatusShow}}</selction></div>"},
                {field: "dataStatus", title: "数据状态", align: "center", width: 90, templet: "#DataStatusTpl"},
                {field: "createTime", title: "添加时间", width: 150},
                {title: "操作", minWidth: 220, align: "center", fixed: "right", templet: "#operationTpl"}
            ]],
            done: function (res, curr, count) {
            }
        });
        okPapper.init();
        okLoading.close($);
    })
</script>
<div th:replace="common/plugin :: pa-input-datatime('ts,te')"></div>
<!-- 头工具栏模板 -->
<script type="text/html" id="toolbarTpl">
    <div class="layui-btn-container">
        <button th:if="${@lj.limit('BaseConstWorkdateAdd')>0}" class="layui-btn layui-btn-sm layui-btn-normal" title="工作日新增" refTable="indexTable" ljUrl="/base/const/workdate/add" target="ljOpenSubmit" ljWidth="400px" ljHeight="300px">
            <i class="layui-icon layui-icon-add-circle"></i>添加工作日
        </button>
    </div>
</script>
<!-- 默认统一操作模板 -->
<script type="text/html" id="operationTpl">
    <button th:if="${@lj.limit('BaseConstWorkdateEdit')>0}" class="layui-btn layui-btn-xs" title="工作日编辑:{{d.id}}" ljUrl="/base/const/workdate/edit?id={{d.id}}" ljWidth="600px" ljHeight="400px" target="ljOpenSubmit"><i class="layui-icon layui-icon-edit"></i>编辑</button>
    <button th:if="${@lj.limit('BaseConstWorkdateDetail')>0}" class="layui-btn layui-btn-xs layui-btn-normal" title="工作日详情:{{d.id}}" ljUrl="/base/const/workdate/detail?id={{d.id}}" ljWidth="800px" target="ljOpenCon"><i class="layui-icon layui-icon-form"></i>详情</button>
    <button th:if="${@lj.limit('BaseConstWorkdateDel')>0}" class="layui-btn layui-btn-xs layui-btn-danger" title="确认要删除该工作日吗?" ljUrl="/base/const/workdate/del?id={{d.id}}" target="ljAjaxTodo"><i class="layui-icon layui-icon-delete"></i>删除</button>
</script>
<!-- DataStatus枚举模板 -->
<div th:replace="common/enum :: pa_enum_DataStatus"></div>
</body>
</html>